<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>商品 编辑页面</title>
    <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
    <jsp:include page="../com/header.jsp"></jsp:include>
    <script type="text/javascript" src="../../js/comm/editcomm.js"></script>
    <script type="text/javascript" src="editShop.js"></script>
</head>
<body>
<section>
    <div>
        <div class="col-xs-12">
            <div class="box" style="height:1550px;padding-bottom:  250px;">
                <div class="box-header">
                    <br>
                    <input type="button" value="确定" id="saveOrupdate" class="btn btn-success">
                    <input type="button" onclick="backAction('shopList.jsp');" class="btn btn-info" value="返回"/>
                </div>
                <form id="submit_form" class="form-horizontal">
                    <div class="tab" id="shopContent">
                    </div>
                </form>
            </div>
        </div>
    </div>
</section>
<script type="text/x-jsrender" id="shopTmpl">
			<fieldset> 
				<input type="hidden" id="tId" name="id" value="{{:id}}" />
				<div class="form-group">
        			<label class="col-md-2 control-label controls" for="formGroupInputSmall">商品名称：</label>
       				 <div class="col-md-4">
						<input type="hidden" id="shopId" name="shopId" value="{{:id}}" />
						<input type="text" placeholder="请填写商品名称" class="form-control input-sm" data-rule="required;length[1~100];"  id="shopProductName" name="shopProductName" value="{{:shopProductName}}" />
					</div>
      			</div>
				<div class="form-group" id="imgUrls_div">
        			<label class="col-md-2 control-label controls" for="formGroupInputSmall">商品图片：</label>
					<div class="col-md-5">
						<img src="../../image/add.png"  class="add_img" style="cursor:pointer;" data-type="0">
						<img src="../../image/jian.png" class="del_img" style="cursor:pointer;" data-type="0">
					</div>
      			</div>
				<div class="form-group">
        			<label class="col-md-2 control-label controls" for="formGroupInputSmall">商品分类：</label>
       				 <div class="col-md-4">
       				    <select name="categoryType" id="categoryType"  data-rule="required" class="form-control input-sm" value="{{:categoryType}}"></select>
					</div>
      			</div>
				<div class="form-group">
        			<label class="col-md-2 control-label controls" for="formGroupInputSmall">库存：</label>
       				 <div class="col-md-4">
						<input type="text" placeholder="请填写库存" class="form-control input-sm" data-rule="required;length[1~50];plus"  maxlength="6"  id="shopProductInventory" name="shopProductInventory" value="{{:shopProductInventory}}" />
					</div>
      			</div>
				<div class="form-group">
        			<label class="col-md-2 control-label controls" for="formGroupInputSmall">品牌：</label>
       				 <div class="col-md-4">
						<input type="text" placeholder="请填写品牌" class="form-control input-sm" data-rule="length[1~50]" maxlength="50" id="brand" name="brand" value="{{:brand}}" />
					</div>
      			</div>
      			<div class="form-group">
        			<label class="col-md-2 control-label controls" for="formGroupInputSmall">排序值：</label>
       				 <div class="col-md-4">
						<input type="text" placeholder="请填写排序值" class="form-control input-sm" data-rule="length[1~10];plus" maxlength="10" id="sort" name="sort" value="{{:sort}}" />
					</div>
      			</div>
      			<div class="form-group">
        			<label class="col-md-2 control-label controls" for="formGroupInputSmall">商品原价：</label>
       				 <div class="col-md-4">
						<input type="text" placeholder="请填写商品原价" class="form-control input-sm" data-rule="required;length[1~50];money" maxlength="10" id="originalPrice" name="originalPrice" value="{{:originalPrice}}" />
					</div>
      			</div>
				<div class="form-group">
        			<label class="col-md-2 control-label controls" for="formGroupInputSmall">商品优惠价格：</label>
       				 <div class="col-md-4">
						<input type="text" placeholder="请填写商品价格" class="form-control input-sm" data-rule="required;length[1~50];money" maxlength="10" id="shopProductPrice" name="shopProductPrice" value="{{:shopProductPrice}}" />
					</div>
      			</div>
      			<div class="form-group">
        			<label class="col-md-2 control-label controls" for="formGroupInputSmall">抵扣比例：</label>
       				 <div class="col-md-4">
						<input type="text" placeholder="请填写抵扣比例[0.00~0.99]" class="form-control input-sm" data-rule="required;length[1~50];starWeigt" maxlength="4" id="discountRate" name="discountRate" value="{{:discountRate}}" />
					</div>
      			</div>
      			<div class="form-group">
        			<label class="col-md-2 control-label controls" for="formGroupInputSmall">规格属性：</label>
					<div class="col-md-2">
					<div style="color:#FF0000;font-size:15px;margin-top:5px;float:right">*</div>
						<img src="../../image/add.png" class="add_img" style="cursor:pointer;margin-right:20px;"   data-type="1">
						<img src="../../image/edit.png" class="edit_img" style="cursor:pointer;margin-right:20px;">
						<img src="../../image/delete.png" class="delete_img" style="cursor:pointer;">
					</div>
      			</div>
      			<div class="form-group">
					<label class="col-md-1 control-label controls" for="formGroupInputSmall">&nbsp;</label>
       				 <div class="col-md-5">
						<table id="standard_table" class="table table-bordered table-hover">
                              <thead>
                                  <tr>
									  <th width="30"><input type="checkbox" id="_selectAll" /></th>
          		               		  <th width="80">规格名称</th>
				               		  <th width="160">规格值</th>
                                  </tr>
                              </thead>
                              <tbody id="standard_content">
                              </tbody>
                          </table>
					  </div>
      			  </div>
      			<div class="form-group">
        			<label class="col-md-2 control-label controls" for="formGroupInputSmall">商品简介：</label>
       				 <div class="col-md-4">
       				    <textarea class="form-control" id="shopProductBrief" name="shopProductBrief" rows="10"
       				    placeholder="请输入商品简介1-5000字符"
       				    data-rule="required;length[1~5000];" date-tip="请输入商品简介1-5000字符"
       				    value="{{:shopProductBrief}}" style="resize:none;">{{:shopProductBrief}}</textarea>
					</div>
      			</div>
      			<div class="form-group">
        			<label class="col-md-2 control-label controls" for="formGroupInputSmall">商品介绍：</label>
        		    <div class="col-md-9" id="shopProductIntroduce" name="shopProductIntroduce" style="height:600px;">
      			</div>
			</fieldset>
</script>
<!-- 添加规格属性弹出框 -->
<div class="modal fade" id="standard_Modal" tabindex="-1" role="dialog"
     aria-labelledby="myModalLabel" aria-hidden="true">
    <form id="standard_Form" class="form-horizontal">
        <div class="modal-dialog">
            <div class="modal-content" style="width:800px;margin-left:-100px;">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal"
                            aria-hidden="true">&times;</button>
                    <h4 class="modal-title" id="myModalLabel">规格属性</h4>
                </div>
                <div class="modal-body">
                    <input type="hidden" id="add_standard" value="" />
                    <div class="form-group">
                        <label class="control-label col-md-3">规格名：</label>
                        <div class="controls col-md-5">
                            <input type="text" placeholder="请填写规格名,如:颜色" id="standardName"
                                   data-rule="required;length[1~50]" data-ok="规格名称可用" data-tip="请输入规格名称"
                                   name="standardName" class="form-control input-sm" />
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-md-3">规格值：</label>
                        <div class="controls col-md-5">
                            <input type="text" placeholder="请填写规格值,多个用逗号分隔(如:红色,白色,蓝色)" id="standardValues"
                                   data-rule="required;length[1~]" name="standardValues" class="form-control input-sm" />
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭
                    </button>
                    <button type="button" id="standard_update" class="btn btn-primary">
                        确定</button>
                </div>
            </div>
        </div>
    </form>
</div>
<!-- 添加规格属性弹出框 end -->
</body>
</html>